package com.spzx.cart.api.factory;

import com.spzx.cart.api.RemoteCartService;
import com.spzx.cart.api.domain.CartInfo;
import com.spzx.common.core.domain.R;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.List;

public class RemoteCartFallbackFactory implements FallbackFactory<RemoteCartService> {
    @Override
    public RemoteCartService create(Throwable cause) {
        return new RemoteCartService() {
            @Override
            public R<List<CartInfo>> getCartCheckedList(Long userId, String from) {
                System.out.println("getCartCheckedList降级。。。");
                return null;
            }

            @Override
            public R<Boolean> updateCartPrice(Long userId, String source) {
                System.out.println("updateCartPrice降级。。。");
                return null;
            }

            @Override
            public R<Boolean> deleteCartCheckedList(Long userId, String source) {
                System.out.println("deleteCartCheckedList降级。。。");
                return null;
            }
        };
    }
}
